part of 'card_info.dart';

class SummarizingCardInfo extends Equatable implements CardInfo {
  SummarizingCardInfo({
    String? cardId,
    required this.lexicalItems,
    required this.lexicalItemProgressPercentMap,
  }) : cardId = cardId ?? UuidGenerator().generateUuid();

  @override
  final String cardId;

  final BuiltList<LexicalItem> lexicalItems;
  final BuiltMap<String, int> lexicalItemProgressPercentMap;

  @override
  List<Object?> get props {
    return [
      cardId,
      lexicalItems,
      lexicalItemProgressPercentMap,
    ];
  }

  SummarizingCardInfo copyWith({
    BuiltList<LexicalItem> Function()? lexicalItems,
    BuiltMap<String, int> Function()? lexicalItemProgressPercentMap,
  }) {
    return SummarizingCardInfo(
      cardId: cardId,
      lexicalItems: lexicalItems == null ? this.lexicalItems : lexicalItems(),
      lexicalItemProgressPercentMap: lexicalItemProgressPercentMap == null
          ? this.lexicalItemProgressPercentMap
          : lexicalItemProgressPercentMap(),
    );
  }
}
